import request from '@/router/axios';
import {
    formateTime
} from '../util/date';
export const list = (data) => request({
    url: '/user-order-item/list',
    method: 'post',
    data
}).then(data => {
    data = data || {};
    data.rows && data.rows.forEach(item => {
        item.create_time = formateTime(item.create_time);
        item.modify_time = formateTime(item.modify_time);
        item.send_time = formateTime(item.send_time);
        item.sign_time = formateTime(item.sign_time);
        item.done_time = formateTime(item.done_time);
        item.receiver_address = item.receiver_province + item.receiver_city + item.receiver_area + item.receiver_address;
    });
    return data;
});

// 发货
export function sendOrderItem(id, expressNo, expressComId) {
    return request({
        url: '/user-order-item/send-order-item',
        method: 'post',
        data: {
            id,
            express_no: expressNo,
            express_com_id: expressComId
        }
    })
}
